home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3710 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: bcfreenet.seflin.lib.fl.us!bcfreenet!z007400b
  2. From: z007400b@bcfreenet.seflin.lib.fl.us (Ralph Silverman)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Problem with ascii to number conversion.
  5. Date: 30 Jan 1996 18:15:46 GMT
  6. Organization: SEFLIN Free-Net - Broward
  7. Distribution: world
  8. Message-ID: <4eln8i$4mv@bcfreenet.seflin.lib.fl.us>
  9. References: <96012012081730705@busilink.com>
  10. NNTP-Posting-Host: bcfreenet.seflin.lib.fl.us
  11. X-Newsreader: TIN [version 1.2 PL2]
  12.  
  13. Paul Kelley (paul.kelley@busilink.com) wrote:
  14. : Hi,
  15. :  i am a beginner c programmer, stuck on what i thought was a simple
  16. : problem. I have an ascii input file that contains payroll info for a
  17. : month, the data is monetary values as ascii strings. I am trying to
  18. : convert the ascii ti numbers total the result then place in another
  19. : file. I am using micrsoft quick C and the ascii to number functions in
  20. : it. Apparenntly these functions only work correctly up to four digits.
  21. : After that teh ouput goes wild.
  22. :  Can anyone help me understand what is not corrrect? Is there any
  23. : routines out there that can do this or am i looking at hardare/softare
  24. : limitation?
  25. :                Any suggestions input or help would subject the giver
  26. :  to a profusion of thanks and positive thoughts.
  27.  
  28. :                                           thanks
  29. :                                        Paul.
  30.  
  31. --
  32. **********begin r.s. response**********
  33.  
  34.     suggest using
  35.         printf()
  36.     for output,
  37.     or
  38.         fprintf()
  39.     let this format for you.
  40.  
  41.     regarding money values...
  42.     do these use decimal extensions
  43.     for cents?
  44.  
  45.     if so,
  46.     your calculation,
  47.     output
  48.     and
  49.     formatting
  50.  
  51.     are not simple integer matters...
  52.  
  53. **********end r.s. response************
  54. Ralph Silverman
  55. z007400b@bcfreenet.seflin.lib.fl.us
  56.  
  57.